Process Analysis Toolkit (PAT) 3.5 Help |
Auction Management [MAJM10] is a simplified online auction management
application that manages posting new items for auction, coordinates the bidding
process, and announces winners. The above defines an external site named as MaxBidSite,
which has forwarded trip delay of 1 time unit and return trip delay of 1 time
unit. The trip delays is the same for all the external sites defined below. The
usage of the site is to publish the highest bid of a list of bid. The above defines an external site
named as Bidders, which maintains a list of bidders
and their bids, and responds to the message nextBidList, which
solicits a list of higher bids for the auctioned item. Auction external site maintains a list of available items
and responds to post, and getNext for adding and retrieving an
item from the list, respectively. It also responses to won for
storing the information of winning item. Seller site, which maintains a list of items to be auctioned
and responds to the message postNext by publishing the next
available item. The above declares a list of global variables. bidItemSet
contains the set of items that has bid on it but has not been sold.
wonItemSet contains the set of item that has been
sold. The posting expression recursively queries a given seller
site for the next item available for auction x, and then posts it to the auction
by calling the Auction site. The bidding expression recursively queries the auction site
for the next item available for auction, where an item is a 3-tuple
(itemid, duration, minValue), with itemid the item
identier, duration its auction duration, and
minValue the starting bid. The expression then collects bids
for the item in rounds from the bidders site for the duration of the auction,
where each round lasts for a maximum of ten unit of time. Once the bidding
ends, the Bidding expression announces the winning information in a
3-tuple (wname, itemid, wbid), with wname the
winning bidder name, itemid the item identifier and
wbid the winning bid before proceeding to the next
item. posting() | bidding() The above specifies that the posting and bidding activities are running in
parallel for an auction. #define hasbid (bidItemSet.size() > 0) The above defines a condition named as hasbid which represents the situation
where there is some items that have bid on it. #define sold (bidItemSet.size() = 0) The above defines a condition named as sold which represents the situation
where there is no item that has bid on it. #define conflict (conflict = true) The above defines a condition named as conflict which represents the
situation where there is more than one winner for a single item. #assert System |= [] (hasbid -> <>
sold); The above checks that if there is some elements that has bid on it,
eventually all of them are sold. #assert System |= []! conflict; The above checks that there will never have more than one winner for a
single item.
conflict is true only when there is more then one
winner for a single item.